var a = require("../../utils/wxcharts.js"), t = getApp(), e = require("../../utils/api.js");

Page({
    data: {
        num: "300.00",
        time: [ "10-01", "10-02", "10-03", "10-04", "10-05", "10-06", "10-07" ],
        business: [ 40.5, 40.6, 40.8, 40.6, 40.3, 40.2, 40.05 ]
    },
    touchHandler: function(a) {
        console.log(null.getCurrentDataIndex(a)), null.showToolTip(a);
    },
    onLoad: function(n) {
        var o = this, r = 320;
        wx.setNavigationBarColor({
            frontColor: wx.getStorageSync("basic").topcolor,
            backgroundColor: wx.getStorageSync("basic").topbg
        }), e.TeamLastSenvenMoney({
            openid: t.globalData.openid
        }).then(function(t) {
            console.log(t);
            var e = [];
            if (0 == t.errno) {
                for (var n in t.data.money) e.push(t.data.money[n]);
                o.setData({
                    time: t.data.data,
                    num: t.data.day,
                    business: e
                });
            }
            try {
                var t = wx.getSystemInfoSync();
                r = t.windowWidth;
            } catch (a) {
                console.error("getSystemInfoSync failed!");
            }
            "" != o.data.time && o.data.time.length > 0 && (reaChart = new a({
                canvasId: "areaCanvas",
                type: "area",
                categories: o.data.time,
                animation: !0,
                series: [ {
                    name: "营业额",
                    data: o.data.business,
                    format: function(a) {
                        return "" != a && null != a && void 0 != a ? "￥" + a : "";
                    }
                } ],
                yAxis: {
                    format: function(a) {
                        return "" != a && null != a && void 0 != a ? "￥" + a : "";
                    }
                },
                xAxis: {
                    disableGrid: !0
                },
                extra: {
                    legendTextColor: "#000"
                },
                width: r,
                height: 200
            }));
        });
    }
});